
module.exports = function (lab) {
    return {
        @findBrandSKUItemCodesNotExists : function (identifier, item_codes = []) {
            return lab.slime.core.@initSession({},identifier).then(function (currentOU) {
                var missingCodes = [];
                @.async.all(item_codes,function (item_code) {
                    
                    lab.find("slime_brand_skus",{
                        ouid : currentOU.id,
                        item_code
                    }).then(async function (brand_sku) {

                        if (!brand_sku) {
                            missingCodes.push(item_code)
                        }

                    }).pipe(this);

                }).resolve(missingCodes).pipe(this);
            })
        }
    }    
}